<template>
	<view>
		<text>用户ID: {{ user.id }}</text>
		<text>用户名: {{ user.name }}</text>
		<button @click="btn">＋1</button>
		<text >计数: {{ user.count}}</text>
	</view>
</template>

<script>
	import 
		{mapState,mapMutations}
	 from "vuex";
	

	export default {
		computed: {
			...mapState({
				user: state => state.user,
				count: state => state.count,
			})
		},methods:{
			...mapMutations(['add']),
			btn(){
				this.add()
				}
			}
		
	};
</script>